/**
 * @Author: Bobby
 * @Date: 2022-02-15 13:14:17
 * @LastEditTime: 2022-03-15 17:29:23
 * @LastEditors: Bobby
 * @Description:
 * @FilePath: \wms-v2\src\ve\common\components\baseComs\wms\uiDynamicForm.js
 * @CIMC-V2
 */
import { exInput, exRequestData, exSwitch } from '@ve/common/components/extension'
import { constantTip } from '@ve/common/components/extension/tip'
export default {
  VERSION: '20220427',
  type: 'uiDynamicFormLot',
  //组件类型
  name: '批次渲染',
  icon: 'information-line',
  svg: 'chanpinpici',
  //数据别名
  // dataName: 'uiDynamicForm_data',
  //子组件列表
  list: [],
  //数据集合 表单 列表等等
  data: {
    requestData: {},
    //表单数据
    formData: {},
  },
  //表单验证
  rules: {},
  //扩展
  extension: {
    api: exInput('Api接口', '/wms/wms-web'),
    method: exInput('Method', 'wms.lot.components.temple.render.select'),
    getDataKey: exInput('获取数据Key', 'wms.lot.components.temple.render.select'),
    requestData: exRequestData('参数', [
      { key: '#LIMIT#', value: 1 },
      { key: '#PAGE_SIZE#', value: 50 },
      { key: 'ORG_ID', value: '#ORG_ID#' },
      { key: 'LOT_ID', value: 'TEMPLE' },
    ]),
    apiDropdown: exInput('下拉Api接口', '/wms/wms-web'),
    methodDropdown: exInput('下拉Method', 'wms.system.code.components.select'),
    getDataKeyDropdown: exInput('下拉获取数据Key', 'wms.system.code.components.select'),
    requestDataDropdown: exRequestData('下拉参数', [
      { key: '#LIMIT#', value: 1 },
      { key: '#PAGE_SIZE#', value: 50 },
      { key: 'CODE', value: 'INPUT_OPTIONS' },
    ]),
    labelField: exInput('label字段', 'label'),
    valueField: exInput('value字段', 'value'),
    disabled: exSwitch('禁用', false),
    IgnoreValidation: exInput('忽略验证', '', '忽略验证字段以英文逗号隔开'),
    prefix: exInput('字段前缀', ''),
    defaultValues: exRequestData('默认值', [], constantTip()),
    enterSelect: {
      type: 'exModuleSelect',
      name: '回车选中',
      value: [],
      hasCheckbox: false,
      treeData: '$getPageModules',
    },
  },
  //交互
  interaction: [],
  //条件、逻辑指令
  logicInstruction: [],
  //数据源绑定
  dataSourceBind: {
    sourceId: {
      type: 'exGetDataSource',
      name: '组件ID',
      value: {
        type: 1,
        source: [],
      },
    },
    // dataKey: exInput('数据Key', ''),
    getDataKey: exInput('数据Key', '', '获取数据的 key 的集合，多个 key 用 “,” 分隔，如需获取全部数据则不填写'),
    hasParam: exSwitch('当参数用', false, '默认当数据使用,开启当参数使用'),
  },
}
